package main

import (
    "facecat"
    "io/ioutil"
)

var gPaint = facecat.CreatePaint()

func WndProc(hwnd facecat.HWND, msg uint32, wParam, lParam uintptr) (result uintptr) {
    return facecat.WndProcDefault(gPaint, hwnd, msg, wParam, lParam)
}

func main() {
    facecat.CreateMainWindow(gPaint, "FaceCat-Go", WndProc)
    xmlStr, _ := ioutil.ReadFile("xml//calendarexample.xml")
    facecat.RenderFaceCat(gPaint, string(xmlStr))
    tabPage := facecat.FindViewByName("TabPage2", gPaint.Views)
    calendar := facecat.CreateView("calendar")
    calendar.Location = facecat.CreatePoint(100, 100)
    calendar.Size = facecat.CreateSize(200, 300)
    facecat.AddViewToParent(calendar, tabPage)
    facecat.InitCalendar(calendar)
    cYear := facecat.GetYear(calendar, 2022)
    cMonth := cYear.Months[10]
    cDay := cMonth.Days[1]
    calendar.GetCalendar().SetSelectedDay(cDay)
    facecat.UpdateCalendar(calendar)
    facecat.ShowWindow(gPaint)
}